<template>
	<view class="container">

		<view class="uni-px-5">
			<view class="text">多选选中：{{JSON.stringify(checkbox5)}}</view>
			<uni-data-checkbox mode="tag" v-model="checkbox5" :localdata="sex" multiple="true" min="0" max="2"></uni-data-checkbox>
		</view>
		<button type="primary" size="mini" @click="add">提交数字</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// radio3: 0,
				checkbox5:[],
				sex: [{
					text: '男',
					value: 0
				}, {
					text: '女',
					value: 1
				}, {
					text: '未知weizhiweixhiweizhiweizhziweiziweizhisissisiisskskskldksks',
					value: 2
				},{
					text:'ceshi',
					value:3
				}],
			}
		},
		methods: {
			add(){
				let checkbox5 = this.$data.checkbox5
				console.log(checkbox5.length);
				if(checkbox5.length!=2){
					console.log("规格错误");
				}else{
					console.log("通过测试");
				}
			}
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
</style>